package com.lonely.fx;

import javafx.application.Application;
import javafx.application.HostServices;
import javafx.stage.Stage;

/**
 * @date: 2022-06-23 14:26
 * @author: ztkj-hzb
 * @description: 演示使用代码打开浏览器，且指定地址，类似 js的 windows.open()
 **/
public class 代码打开默认浏览器 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    /**
     *
     */
    @Override
    public void start(Stage primaryStage) throws Exception {

        HostServices hostServices = super.getHostServices();
        hostServices.showDocument("www.baidu.com");

    }
}
